// 复制 / 写入剪切板
export const writeClip = (text: string) =>
  navigator.clipboard
    .writeText(text)
    .then(() => {
      //   console.log("Text copied to clipboard");
    })
    .catch((err) => {
      console.error("Error in copying text: ", err);
    });

// 读取剪切板
export const readClip = () =>
  navigator.clipboard
    .readText()
    .then((text) => {
      return text;
      //   console.log("Pasted content: ", text);
    })
    .catch((err) => {
      console.error("Error in pasting text: ", err);
    });
